.class public Lorg/zeam/ApplicationsPageView;
.super Landroid/widget/LinearLayout;
.source "ApplicationsPageView.java"


# instance fields
.field private mLayoutInflater:Landroid/view/LayoutInflater;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 23
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 24
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 19
    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 20
    return-void
.end method


# virtual methods
.method populatePage(ZIILjava/util/List;Landroid/view/View$OnLongClickListener;Landroid/view/View$OnClickListener;)V
    .locals 23
    .parameter "uninstalling"
    .parameter "rows"
    .parameter "columns"
    .parameter
    .parameter "onLongClickListener"
    .parameter "onClickListener"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(ZII",
            "Ljava/util/List",
            "<",
            "Lorg/zeam/ApplicationItemInfo;",
            ">;",
            "Landroid/view/View$OnLongClickListener;",
            "Landroid/view/View$OnClickListener;",
            ")V"
        }
    .end annotation

    .prologue
    .line 31
    .local p4, applicationItemInfos:Ljava/util/List;,"Ljava/util/List<Lorg/zeam/ApplicationItemInfo;>;"
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getContext()Landroid/content/Context;

    move-result-object v7

    .line 32
    .local v7, context:Landroid/content/Context;
    invoke-static {v7}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v19

    move-object/from16 v0, v19

    move-object/from16 v1, p0

    iput-object v0, v1, Lorg/zeam/ApplicationsPageView;->mLayoutInflater:Landroid/view/LayoutInflater;

    .line 34
    new-instance v13, Landroid/graphics/Rect;

    invoke-direct {v13}, Landroid/graphics/Rect;-><init>()V

    .line 35
    .local v13, rect:Landroid/graphics/Rect;
    move-object/from16 v0, p0

    move-object v1, v13

    invoke-virtual {v0, v1}, Lorg/zeam/ApplicationsPageView;->getWindowVisibleDisplayFrame(Landroid/graphics/Rect;)V

    .line 36
    invoke-virtual {v13}, Landroid/graphics/Rect;->height()I

    move-result v8

    .line 37
    .local v8, height:I
    invoke-virtual {v13}, Landroid/graphics/Rect;->width()I

    move-result v17

    .line 39
    .local v17, width:I
    div-int v19, v8, p2

    move/from16 v0, v19

    int-to-double v0, v0

    move-wide/from16 v19, v0

    const-wide v21, 0x3fea8f5c28f5c28fL

    mul-double v19, v19, v21

    move-wide/from16 v0, v19

    double-to-int v0, v0

    move v14, v0

    .line 40
    .local v14, rowHeight:I
    mul-int v19, v14, p2

    sub-int v19, v8, v19

    move/from16 v0, v19

    int-to-double v0, v0

    move-wide/from16 v19, v0

    const-wide v21, 0x400999999999999aL

    div-double v19, v19, v21

    move-wide/from16 v0, v19

    double-to-int v0, v0

    move/from16 v16, v0

    .line 41
    .local v16, topPadding:I
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getPaddingRight()I

    move-result v19

    sub-int v19, v17, v19

    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getPaddingLeft()I

    move-result v20

    sub-int v18, v19, v20

    .line 42
    .local v18, widthMinusPadding:I
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getPaddingLeft()I

    move-result v19

    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getPaddingRight()I

    move-result v20

    invoke-virtual/range {p0 .. p0}, Lorg/zeam/ApplicationsPageView;->getPaddingBottom()I

    move-result v21

    move-object/from16 v0, p0

    move/from16 v1, v19

    move/from16 v2, v16

    move/from16 v3, v20

    move/from16 v4, v21

    invoke-virtual {v0, v1, v2, v3, v4}, Lorg/zeam/ApplicationsPageView;->setPadding(IIII)V

    .line 44
    const/4 v10, 0x0

    .line 45
    .local v10, index:I
    const/4 v12, 0x0

    .local v12, r:I
    :goto_0
    move v0, v12

    move/from16 v1, p2

    if-lt v0, v1, :cond_0

    .line 95
    return-void

    .line 47
    :cond_0
    new-instance v11, Landroid/widget/LinearLayout;

    invoke-direct {v11, v7}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 48
    .local v11, linearLayout:Landroid/widget/LinearLayout;
    new-instance v19, Landroid/widget/LinearLayout$LayoutParams;

    const/16 v20, -0x1

    const/16 v21, -0x1

    invoke-direct/range {v19 .. v21}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    move-object v0, v11

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 49
    const/16 v19, 0x0

    move-object v0, v11

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 50
    move-object v0, v11

    move/from16 v1, v18

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setMinimumWidth(I)V

    .line 51
    invoke-virtual {v11, v14}, Landroid/widget/LinearLayout;->setMinimumHeight(I)V

    .line 53
    const/4 v6, 0x0

    .local v6, c:I
    :goto_1
    move v0, v6

    move/from16 v1, p3

    if-lt v0, v1, :cond_2

    .line 93
    :cond_1
    new-instance v19, Landroid/widget/LinearLayout$LayoutParams;

    const/16 v20, -0x1

    const/16 v21, -0x1

    invoke-direct/range {v19 .. v21}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    move-object/from16 v0, p0

    move-object v1, v11

    move-object/from16 v2, v19

    invoke-virtual {v0, v1, v2}, Lorg/zeam/ApplicationsPageView;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 45
    add-int/lit8 v12, v12, 0x1

    goto :goto_0

    .line 55
    :cond_2
    invoke-interface/range {p4 .. p4}, Ljava/util/List;->size()I

    move-result v19

    move v0, v10

    move/from16 v1, v19

    if-ge v0, v1, :cond_1

    .line 58
    move-object/from16 v0, p4

    move v1, v10

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lorg/zeam/ApplicationItemInfo;

    .line 59
    .local v5, applicationItemInfo:Lorg/zeam/ApplicationItemInfo;
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/ApplicationsPageView;->mLayoutInflater:Landroid/view/LayoutInflater;

    move-object/from16 v19, v0

    const v20, 0x7f030002

    const/16 v21, 0x0

    const/16 v22, 0x0

    invoke-virtual/range {v19 .. v22}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v15

    check-cast v15, Landroid/widget/TextView;

    .line 61
    .local v15, textView:Landroid/widget/TextView;
    move-object v0, v5

    iget-boolean v0, v0, Lorg/zeam/ApplicationItemInfo;->filtered:Z

    move/from16 v19, v0

    if-nez v19, :cond_3

    .line 62
    move-object v0, v5

    iget-object v0, v0, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v19, v0

    move-object/from16 v0, v19

    move-object v1, v7

    invoke-static {v0, v1}, Lorg/zeam/Utilities;->createIconThumbnail(Landroid/graphics/drawable/Drawable;Landroid/content/Context;)Landroid/graphics/drawable/Drawable;

    move-result-object v19

    move-object/from16 v0, v19

    move-object v1, v5

    iput-object v0, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    .line 63
    const/16 v19, 0x1

    move/from16 v0, v19

    move-object v1, v5

    iput-boolean v0, v1, Lorg/zeam/ApplicationItemInfo;->filtered:Z

    .line 67
    :cond_3
    if-eqz p1, :cond_5

    .line 68
    invoke-static {v7, v5}, Lorg/zeam/Utilities;->canUninstallApplication(Landroid/content/Context;Lorg/zeam/ApplicationItemInfo;)Z

    move-result v19

    if-eqz v19, :cond_4

    .line 70
    const/16 v19, -0x1

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    .line 71
    move-object v0, v5

    iget-object v0, v0, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v19, v0

    move-object v0, v7

    move-object/from16 v1, v19

    invoke-static {v0, v1}, Lorg/zeam/Utilities;->overlayUninstallIcon(Landroid/content/Context;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v9

    .line 76
    .local v9, iconDrawable:Landroid/graphics/drawable/Drawable;
    :goto_2
    const v19, 0x106000d

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setBackgroundResource(I)V

    .line 83
    :goto_3
    const/16 v19, 0x0

    const/16 v20, 0x0

    const/16 v21, 0x0

    move-object v0, v15

    move-object/from16 v1, v19

    move-object v2, v9

    move-object/from16 v3, v20

    move-object/from16 v4, v21

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/widget/TextView;->setCompoundDrawablesWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    .line 84
    move-object v0, v15

    move-object/from16 v1, p5

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    .line 85
    div-int v19, v18, p3

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setWidth(I)V

    .line 86
    move-object v0, v15

    move-object/from16 v1, p6

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 87
    move-object v0, v5

    iget-object v0, v0, Lorg/zeam/ApplicationItemInfo;->title:Ljava/lang/CharSequence;

    move-object/from16 v19, v0

    move-object v0, v15

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 88
    invoke-virtual {v15, v5}, Landroid/widget/TextView;->setTag(Ljava/lang/Object;)V

    .line 89
    invoke-virtual {v11, v15}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 90
    add-int/lit8 v10, v10, 0x1

    .line 53
    add-int/lit8 v6, v6, 0x1

    goto/16 :goto_1

    .line 73
    .end local v9           #iconDrawable:Landroid/graphics/drawable/Drawable;
    :cond_4
    const v19, -0x777778

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    .line 74
    move-object v0, v5

    iget-object v0, v0, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v19, v0

    invoke-static/range {v19 .. v19}, Lorg/zeam/Utilities;->adjustIconOpacity(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v9

    .restart local v9       #iconDrawable:Landroid/graphics/drawable/Drawable;
    goto :goto_2

    .line 79
    .end local v9           #iconDrawable:Landroid/graphics/drawable/Drawable;
    :cond_5
    const/16 v19, -0x1

    move-object v0, v15

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    .line 80
    iget-object v9, v5, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    .line 81
    .restart local v9       #iconDrawable:Landroid/graphics/drawable/Drawable;
    const/16 v19, 0x1

    move-object v0, v7

    move/from16 v1, v19

    invoke-static {v0, v1}, Lorg/zeam/SelectorDrawable;->createSelector(Landroid/content/Context;Z)Lorg/zeam/SelectorDrawable;

    move-result-object v19

    move-object v0, v15

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_3
.end method
